package cc.orange.mainView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.GridLayoutManager;
import cc.orange.R;
import cc.orange.adapter.WalletAdapter;
import cc.orange.databinding.ActivityWalletBinding;
import cc.orange.entity.HightEntity;
import com.tendcloud.tenddata.TalkingDataSDK;

import android.os.Bundle;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class WalletActivity extends AppCompatActivity implements View.OnClickListener{

    private ActivityWalletBinding binding;
    private WalletAdapter adapter;
    private List<HightEntity>list = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.activity_wallet);
        binding.walletImg3.setOnClickListener(this);
        initViews();
    }

    private void initViews() {
        for (int i = 0; i < 10; i++) {
            list.add(new HightEntity(0));
        }
        adapter = new WalletAdapter(list);
        GridLayoutManager layoutManager = new GridLayoutManager(this, 2);
        binding.walletRecycler.setLayoutManager(layoutManager);
        binding.walletRecycler.setAdapter(adapter);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.wallet_img3:
                finish();
                break;
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        TalkingDataSDK.onPageBegin(this, getLocalClassName());
    }

    @Override
    protected void onPause() {
        super.onPause();
        TalkingDataSDK.onPageEnd(this, getLocalClassName());
    }
}